<?php

use Illuminate\Support\Facades\Route;
use Illuminate\Support\Facades\Auth;
use App\WeChat\ApiController;

//测试wechat包
Route::any('wechat/api/{site}/{model}', [ApiController::class, 'handle'])->middleware('site');

//网站首页
Route::get('/', function () {
    $class = "Modules\Article\Http\Controllers\HomeController";
    return app($class)->home();
})->middleware('module');

//退出登录
Route::get('logout', function () {
    Auth::logout();
});

//后备路由（没有可匹配路由时执行这里）
Route::fallback(function () {
    return view('app');
});
